package com.ssm.helong.shop.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;
@Data
public class GoodsCategory {
    //分类id
    private Integer categoryId;
    //分层级别(1-一级分类2-二级分类3-三级分类)
    private Integer categoryLevel;
    //父分类id
    private Integer parentId;
    //分类名称
    private String categoryName;
    //排序值
    private Integer categoryRank;
    //删除标识字段(0-未删除 1-已删除)
    private Integer isDeleted;
    //创建时间
    private String createTime;
    //创建者id
    private Integer createUser;
    //修改时间
    private String updateTime;
    //删除标识字段(0-未删除 1-已删除)
    private Integer updateUser;
    //等级
    private Integer level;
    //GoodsCategory对象
    private List<GoodsCategory> childGoodsCategory;

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public List <GoodsCategory> getChildGoodsCategory() {
        return childGoodsCategory;
    }

    public void setChildGoodsCategory(List <GoodsCategory> childGoodsCategory) {
        this.childGoodsCategory = childGoodsCategory;
    }

    public void addChild(GoodsCategory child){
       childGoodsCategory.add(child);
    }
    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public Integer getCategoryLevel() {
        return categoryLevel;
    }

    public void setCategoryLevel(Integer categoryLevel) {
        this.categoryLevel = categoryLevel;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Integer getCategoryRank() {
        return categoryRank;
    }

    public void setCategoryRank(Integer categoryRank) {
        this.categoryRank = categoryRank;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public Integer getCreateUser() {
        return createUser;
    }

    public void setCreateUser(Integer createUser) {
        this.createUser = createUser;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(Integer updateUser) {
        this.updateUser = updateUser;
    }

    @Override
    public String toString() {
        return "GoodsCategory{" +
                "categoryId=" + categoryId +
                ", categoryLevel=" + categoryLevel +
                ", parentId=" + parentId +
                ", categoryName='" + categoryName + '\'' +
                ", categoryRank=" + categoryRank +
                ", isDeleted=" + isDeleted +
                ", createTime='" + createTime + '\'' +
                ", createUser=" + createUser +
                ", updateTime='" + updateTime + '\'' +
                ", updateUser=" + updateUser +
                '}';
    }
}
